//2.6
import java.util.Scanner;
public class SumAllDigits{
    public static void main(String[] args){
        Scanner input= new Scanner(System.in);
        System.out.print("Enter a number between 0 and 999 :");
        int number = input.nextInt();
        int sum=0;
        int n=number;
        while (n>0){
            int digit=n%10;
            sum+=digit;
            n=n/10;
        }

        System.out.println("The sum of the digits is "+sum);
    }
}
